<table class="formtable">
	<tr>
		<th width="65%">Producto</th>
		<th width="11%">Cantidad</th>
		<th width="11%">Precio</th>
		<th width="13%">SubTotal</th>
	</tr>
	<tr>
	      <td colspan="4" class="hr"></td>
	</tr>
<?php
	foreach($user->order->items as $item) {
?>
	<tr class="product">
		<td>
			<a myFor="largeproduct" href="?section=large_item&products_id=<?php print $item->item_id; ?>"><?php print $item->name; ?></a>
		</td>
		<td class="quantity" style="text-align:center">
			<?php echo $item->quantity; ?>
		</td>
		<td class="price" style="text-align:right"><?php echo number_format($item->price, 2, ',', ' '); ?> €</td>
		<td class="total" style="text-align:right"><?php echo number_format($item->price * $item->quantity, 2, ',', ' '); ?> €</td>
	</tr>
<?php
	}
?>
	<tr>
	      <td colspan="4" class="hr"></td>
	</tr>
	<tr class="total">
		<td colspan="3">Subotal:</td>
		<td style="text-align:right"><?php print number_format($user->order->subTotal, 2, ',', ' '); ?> €</td>
	<tr class="total">
		<td colspan="3">Gastos de cobro:</td>
		<td style="text-align:right"><?php print number_format($user->order->payment->method->price, 2, ',', ' '); ?> €</td>
	</tr>
	<tr class="total">
		<td colspan="3">Gastos de envio:</td>
		<td style="text-align:right"><?php print number_format($user->order->delivery->shipping_type->price, 2, ',', ' '); ?> €</td>
	</tr>
	<tr class="total">
		<td colspan="3">Total:</td>
		<td style="text-align:right"><?php print number_format($user->order->price, 2, ',', ' '); ?> €</td>
	</tr>
</table>
<div class="space"></div>
<table class="formtable">
	<tr>
		<th colspan="2">Domicilio de Entrega:</th>
	</tr>
	<tr>
	      <td colspan="4" class="hr"></td>
	</tr>
	<tr>
		<td width="29%">Nombre:</td>
		<td width="71%"><?php print $user->order->delivery->address->firstname . " " . $user->order->delivery->address->lastname; ?></td>
	</tr>
	<tr>
		<td width="29%">Dirección:</td>
		<td width="71%"><?php print $user->order->delivery->address->street; ?></td>
	</tr>
	<tr>
		<td width="29%"> Población:</td>
		<td width="71%"><?php print $user->order->delivery->address->city; ?></td>
	</tr>
	<tr>
		<td width="29%">Provincia:</td>
		<td width="71%"><?php print $user->order->delivery->address->zone->name; ?></td>
	</tr>
	<tr>
		<td width="29%">País:</td>
		<td width="71%"><?php print $user->order->delivery->address->country->name; ?></td>
	</tr>
	<tr>
		<td width="29%"> Código Postal:</td>
		<td width="71%"><?php print $user->order->delivery->address->postcode; ?></td>
	</tr>
	<tr>
		<td width="29%">Teléfono:</td>
		<td width="71%"><?php print $user->order->delivery->phone; ?></td>
	</tr>
	<?php if ($user->order->delivery->sec_phone) { ?>
	<tr>
		<td width="29%">Otro teléfono:</td>
		<td width="71%"><?php print $user->order->delivery->sec_phone; ?></td>
	</tr>
	<?php } ?>
	<tr>
	      <td class="hr" colspan="2"></td>
	</tr>
</table>
<div class="space"></div>
<table class="formtable" width="100%">
	<tr>
		<th colspan="2">Indicaciones de Entrega:</th>
	</tr>
	<tr>
	      <td colspan="4" class="hr"></td>
	</tr>
	<tr>
		<td>
			<p>El método de envío elegido es <?php print $user->order->delivery->shipping_type->name; ?>.</p>
		</td>
	</tr>
</table>
<div class="space"></div>
<table class="formtable" width="100%">
	<tr>
		<th colspan="2">Indicaciones de Pago:</th>
	</tr>
	<tr>
	      <td colspan="4" class="hr"></td>
	</tr>
	<tr>
		<td>
			<p>El método de pago elegido es <?php print $user->order->payment->method->name; ?>.</p>
		</td>
	</tr>
</table>
<?php
	if ($user->order->status == 1) {
?>
<div class="space"></div>
<div align="center">
	<form method="post" action="?section=cancel_order" myFor="cancelOrder" id="cancelOrderForm">
		<input value="Cancelar pedido" type="submit">
	</form>
</div>
<?php
	}
?>
<script type="text/javascript">
document.getElementById("cancelOrderForm").onsubmit = function () {
	this.request();
	// This is for reloading notifications. (Last order)
	setViewTo("?section=notifications","rightContentBox:ajaxcontentarea");
	return false;
}
</script>
